// Copyright  2004-2008 Backplane Ltd.
//
// This file is part of Ubiquity formsPlayer
//
// Ubiquity formsPlayer is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3 of the License, or (at your
// option) any later version.
//
// Ubiquity formsPlayer is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License
// along with Ubiquity formsPlayer If not, see <http://www.gnu.org/licenses/>.
//	
//
//   Purpose: declaration of .
//   $Id$

#pragma once

#include "submission.h"

// CComBSTRMap defined in submission.h

class CSubmissionExtension
{
	public:
		CSubmissionExtension(void);
		~CSubmissionExtension(void);
	public:
		HRESULT SetTemplate(IXMLDOMNode * pNodeTemplate);
		HRESULT SetInstance(IXMLDOMNode * pNodeInstance);
		HRESULT get_evaluator(IXPathEvaluator ** pVal);
		HRESULT putref_evaluator(IXPathEvaluator * newVal);
		
		HRESULT GetAction(CComBSTR &sAction);
		HRESULT GetInstanceRef(CComBSTR &sRef);
		HRESULT GetInstanceBind(CComBSTR &sBind);
		HRESULT GetEncoding(CComBSTR &sEncoding);
		HRESULT GetMethod(CComBSTR &sMethod);
		HRESULT CSubmissionExtension::GetReturnInstance(CComBSTR &sInstance);
		HRESULT GetMediaType(CComBSTR &sMediaType);
		HRESULT GetHeaders(CComBSTRMap &pHeadersList);
		HRESULT GetUsername(CComBSTR &sUsername);
		HRESULT GetPassword(CComBSTR &sPassword);
		HRESULT GetSerialisation(CImplSubmitInfo::ESerialisation * eSerialisation);
		
	private:
		CComPtr<IXMLDOMNode> m_pTemplateNode;
		CComPtr<IXMLDOMNode> m_pInstanceNode;
		CComPtr<IXPathEvaluator> m_pEvaluator;

	private:
		HRESULT getNodeText(BSTR sTemplateXPath, CComBSTR & bsValue);
        HRESULT	getNodeText(IXMLDOMNode * pTemplateNode, CComBSTR & bsValue);

		/*
		HRESULT makeHeaders(IXMLDOMNode * pNode);
		HRESULT addXMLDeclaration(IXMLDOMNode * pNTemplate, IXMLDOMDocument * pXMLDOM);

		HRESULT getBody(IXMLDOMNode * pNode, VARIANT * vtBody);
		HRESULT getXMLDOM(IXMLDOMDocument2 ** pDOM);
		*/
};
